package graph;

import interfaces.WorldNodeInterface;

import java.util.ArrayList;




public class NodeWorld implements Comparable<NodeWorld> {
	
	private NodeWorld source;         //used to calculate path
	private WorldNodeInterface object;
	private ArrayList<NodeArc> arcList;
	private int accDistance=0;
	
	
	public NodeWorld(WorldNodeInterface object){
		source=null;
		this.object=object;
		arcList= new ArrayList<NodeArc>();
	}

	public NodeWorld getSource() {
		return source;
	}

	public void setSource(NodeWorld source) {
		this.source = source;
	}

	public WorldNodeInterface getObject() {
		return object;
	}

	public void setObject(WorldNodeInterface object) {
		this.object = object;
	}

	public ArrayList<NodeArc> getArcList() {
		return arcList;
	}

	public void setArcList(ArrayList<NodeArc> arcList) {
		this.arcList = arcList;
	}
	
	public void addArc(NodeArc arc){
		arcList.add(arc);
	}

	public int getAccDistance() {
		return accDistance;
	}

	public void setAccDistance(int accDistance) {
		this.accDistance = accDistance;
	}

	@Override
	public int compareTo(NodeWorld o) {
		if (accDistance<o.accDistance){
			return -1;
		}
		if(accDistance>o.accDistance){
			return 1;
		}
		return 0;
	}

	
}
